/**
 * Description:一些注释<br/>
 * CreateTime:2019-03-25<br/>
 * Creater: yangpengfei360@126.com <br/>
 * @author yangpengfei
 */
package cn.cnsy123.bookwebsiteserver.entity;

import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 * Description:一些注释<br/>
 * CreateTime:2019-03-25<br/>
 * Creater: yangpengfei360@126.com <br/>
 * @author yangpengfei
 */
@Entity
@Table(name = "BOOK_SYSTEM_USER")
public class SysUser {
    
    @Id
    @GeneratedValue(strategy=GenerationType.IDENTITY)
    @Column(name = "USER_ID",length=11,nullable=false,unique=true)
    private Long userId;
    
    @Column(name = "USER_NAME",length = 20,nullable = false,unique = true)
    private String userName;
    
    @Column(name = "PASS_WORD",length = 180,nullable = false)
    private String passWord;
    
    @Column(name = "REGISTER_TIME")
    @Temporal(TemporalType.TIMESTAMP)
    private Date registerTime;
    
    @Column(name = "LAST_LOGIN_IP")
    private String lastLoginIP;
    
    @Column(name = "IS_DELETED",length = 1)
    private Short deleteFlag = 0;//默认不可以删除

    public Long getUserId() {
        return userId;
    }

    public void setUserId(Long userId) {
        this.userId = userId;
    }

    public String getUserName() {
        return userName;
    }

    public void setUserName(String userName) {
        this.userName = userName;
    }

    public String getPassWord() {
        return passWord;
    }

    public void setPassWord(String passWord) {
        this.passWord = passWord;
    }

    public Date getRegisterTime() {
        return registerTime;
    }

    public void setRegisterTime(Date registerTime) {
        this.registerTime = registerTime;
    }

    public String getLastLoginIP() {
        return lastLoginIP;
    }

    public void setLastLoginIP(String lastLoginIP) {
        this.lastLoginIP = lastLoginIP;
    }

    @Override
    public String toString() {
        StringBuilder builder = new StringBuilder();
        builder.append("\"SysUser\":{\"userId\":");
        builder.append(userId);
        builder.append(", userName\":");
        builder.append(userName);
        builder.append(", passWord\":");
        builder.append(passWord);
        builder.append(", registerTime\":");
        builder.append(registerTime);
        builder.append(", lastLoginIP\":");
        builder.append(lastLoginIP);
        builder.append("}");
        return builder.toString();
    }

   

   
    
    
    

}
